@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap');

:root {
  --first-color: hsl(231, 48%, 56%);
  --title-color: hsl(231, 24%, 20%);
  --text-color: hsl(231, 4%, 45%);
  --body-color: hsl(231, 100%, 99%);
  --container-color: #fff;

  --body-font: 'Poppins', sans-serif;
  --tiny-font-size: 0.625rem;
}

@media screen and (min-width: 992px) {
  :root {
    --tiny-font-size: 0.688rem;
  }
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  background-color: var(--body-color);
  color: var(--text-color);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

.container {
  max-width: 992px;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.container section {
  height: 100vh;
  padding: 2rem 0;
}

.container h2 {
  text-align: center;
  color: var(--title-color);
}

.nav {
  position: fixed;
  bottom: 2rem;
  left: 0;
  right: 0;
  width: 350px;
  height: 72px;
  background-color: var(--container-color);
  box-shadow: 0 8px 32px hsla(231, 44%, 45%, 0.2);
  margin: 0 auto;
  padding: 1.5rem 0.5rem;
  border-radius: 0.65rem;
  overflow: hidden;
}

.nav-list {
  display: flex;
  justify-content: center;
  column-gap: 2rem;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nav-link i {
  font-size: 1.5rem;
  color: var(--title-color);
  z-index: 20;
  transition: 0.3s;
}

.nav-name {
  font-size: var(--tiny-font-size);
  position: absolute;
  font-weight: 500;
  transition: 0.4s;
  transform: translateY(50px);
  z-index: 20;
  color: var(--body-color);
  opacity: 0;
}

.indicator {
  position: absolute;
  left: 3px;
  bottom: 0;
  fill: var(--first-color);
  transition: 0.3s;
}

.active-link i {
  color: var(--body-color);
}

.active-link .nav-name {
  opacity: 1;
  transform: translateY(28px);
}

.nav-link:nth-child(1).active-link ~ .indicator {
  transform: translateX(calc(62px * 0));
}

.nav-link:nth-child(2).active-link ~ .indicator {
  transform: translateX(calc(62px * 1));
}

.nav-link:nth-child(3).active-link ~ .indicator {
  transform: translateX(calc(62px * 2));
}

.nav-link:nth-child(4).active-link ~ .indicator {
  transform: translateX(calc(62px * 3));
}

.nav-link:nth-child(5).active-link ~ .indicator {
  transform: translateX(calc(63px * 4));
}

@media screen and (max-width: 320px) {
  .nav {
    zoom: 0.8;
  }
}

/* For large devices */
@media screen and (min-width: 992px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }
  .nav {
    zoom: 1.1;
  }
}
